import AluMerge from "./AluMerge";
import CommonMerge from "./CommonMerge";
import SPMerge from "./SPMerge";


export default class ParamMerge implements IParamsMerge{

    merges: Array<IParamsMerge> = [];

    private static _ins: ParamMerge;
    static get ins(): ParamMerge{
        if(this._ins == null){
            this._ins = new ParamMerge();
        }

        return this._ins;
    }

    private constructor(){
        this.merges = [];

        this.merges.push(new CommonMerge());
        this.merges.push(new AluMerge());
        this.merges.push(new SPMerge());
    }

    merge(t: any, id: any) {
        for(let c of this.merges){
            c.merge(t, id);
        }
    }
}